<style>
  .father {
    width: 300px;
    height: 300px;
    background-color: #000;

    display: flex;
    justify-content: center;
    align-items: center;
  }

  .son {
    width: 150px;
    height: 150px;
    background-color: green;
  }
</style>

<div class="father">
  <div class="son"></div>
</div>
